home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6621 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.4 KB  |  73 lines

  1. Newsgroups: comp.lang.c
  2. Path: genesis.ilinkgn.net!not-for-mail
  3. From: johno@ilinkgn.net (john)
  4. Subject: HELP!! Need help with a printer driver in C++
  5. Message-ID: <2f7cc$10232.cf@genesis.ilinkgn.net>
  6. Date: Thu, 15 Feb 1996 21:35:02 GMT
  7. Organization: ilink global networks
  8. X-Newsreader: WinVN 0.99.7
  9. MIME-Version: 1.0
  10. Content-Type: Text/Plain; charset=US-ASCII
  11.  
  12. I am trying to write a printer driver in c++ using classes and inline 
  13. functions that are called to change the settings of an HP printer and 
  14. then reset the printer with a destructor after each is executed.  Any 
  15. help would be appreciated greatly!
  16.  
  17. Thanks
  18. C++
  19. Novice
  20.  
  21. #include <iostream.h>
  22. #include <iomanip.h>
  23. #include <fstream.h>
  24.  
  25.  
  26.  
  27.  class Printer{
  28.  
  29.     ofstream prt;
  30.  
  31.     public:
  32.     Printer()
  33.  
  34.  
  35.      prt open ("prn");  // <<<--- KEEP GETTING
  36.                 // "DECLARATION TERMINATED INCORRECTLY 
  37. ERRORS
  38.  
  39.         
  40.     void bold() {prt << "\x1B\x28\x73\x33\x42";}
  41.     void score() {prt << "\x1B\x26\x64\x44";}
  42.     void clmarg() {prt << "\x1B\x39";}
  43.     void lscape() {prt << "\x1B\x26\x6C\x31\x4F";}
  44.     void portrt() {prt << "\x1B\x26\x6C\x30\x4F";}
  45.     void italic() {prt << "\x1B\x28\x73\x31\x53";}
  46.     void uprite() {prt << "\x1B\x28\x73\x30\x53";}
  47.  
  48. };
  49. {        
  50.  
  51.     ~Printer();
  52.     
  53.      void(){prt << "\x1B\x45";}
  54.      reset;
  55.      
  56.      prt close ("prn"); // <<<--- KEEP GETTING
  57.                 // "DECLARATION TERMINATED INCORRECTLY 
  58. ERRORS
  59.      
  60. }
  61. print line (char s [])
  62.  void page(){prt << '\f';}
  63.   
  64.  void main ()
  65.  
  66.  {
  67.   
  68.  }
  69.  
  70.  
  71.